package com.niiwoo.civet.trade.dao.mapper;

import com.niiwoo.civet.trade.dao.entity.ProjectFlowExecuteRuntime;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ProjectFlowExecuteRuntimeMapperExt extends ProjectFlowExecuteRuntimeMapper {

    /**
     * 通过节点id和状态查找标的申请流程执行表
     * @param nodeId
     * @param nodeStatus
     * @return
     */
    List<ProjectFlowExecuteRuntime> queryByStatusANode(@Param("nodeId")int nodeId,@Param("nodeStatus")Byte nodeStatus);

    /**
     * 获取借款流程异常的记录
     * @return
     */
	List<ProjectFlowExecuteRuntime> findLoanFlowExceptionRetryRecord();

	/**
	 * 获取借款流程天秤超时未回调记录
	 * @return
	 */
	List<ProjectFlowExecuteRuntime> findTianchengCallbackTimeOutRecord(@Param("updateTime")Date updateTime);

    /**
     * 按超时时间 通过节点id和状态查找标的申请流程执行表
     * @param nodeId
     * @param nodeStatus
     * @param timeoutMinute  超时分钟
     * @return
     */
    List<ProjectFlowExecuteRuntime> queryByStatusANodeAtimeout(@Param("nodeId")int nodeId,@Param("nodeStatus")Byte nodeStatus, @Param("outTimeMinute") int timeoutMinute);
}